---
sidebar_class_name: node-only
---

# File System Store

:::tip Compatibility
Only available on Node.js.
:::

This example demonstrates how to setup chat history storage using the `LocalFileStore` KV store integration.

## Usage

:::info
The path passed to the `.fromPath` must be a directory, not a file.
:::

The `LocalFileStore` is a wrapper around the `fs` module for storing data as key-value pairs.
Each key value pair has its own file nested inside the directory passed to the `.fromPath` method.
The file name is the key and inside contains the value of the key.

import CodeBlock from "@theme/CodeBlock";
import Example from "@examples/stores/file_system_storage.ts";

<CodeBlock language="typescript">{Example}</CodeBlock>
